﻿namespace Vdc.Grid
{
    using System;
    using System.ComponentModel;
    using System.Web.UI;

    public class CustomFilterOption : FilterOption
    {
        private string id;
        private FilterOptionTemplateSettings templateSettings;
        private string text;

        public CustomFilterOption()
        {
            this.Type = FilterOptionType.Custom;
            this.templateSettings = new FilterOptionTemplateSettings();
        }

        internal override string GetID()
        {
            return this.ID;
        }

        internal override string GetText(Vdc.Grid.Grid grid)
        {
            return this.Text;
        }

        public string ID
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }

        [PersistenceMode(PersistenceMode.InnerProperty), Category("Filter Option Template Settings"), Description("Property used to define the template settings for the FilterOption."), NotifyParentProperty(true), Bindable(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        public FilterOptionTemplateSettings TemplateSettings
        {
            get
            {
                return this.templateSettings;
            }
            set
            {
                this.templateSettings = value;
            }
        }

        public string Text
        {
            get
            {
                return this.text;
            }
            set
            {
                this.text = value;
            }
        }

        [Description("The type of the filter option."), Bindable(true)]
        public override FilterOptionType Type
        {
            get
            {
                return FilterOptionType.Custom;
            }
            set
            {
            }
        }
    }
}

